package cn.net.cfss.fgbp.face.console.service;

import cn.net.cfss.fgbp.spi.manage.constant.OperationTypeEnum;
import cn.net.cfss.fgbp.spi.manage.dto.FscLogOperationDto;
import cn.net.cfss.fgbp.spi.manage.inte.IFscLogOperationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author wutao
 * @version 1.0
 * @date 2020/10/13 14:24
 */
@Service
@Slf4j
public class OperationService {

    @Autowired
    private IFscLogOperationService fscLogOperationService;

    public void addOperationLog(OperationTypeEnum operationType, String opRemark, String oldData, String newData) {
        FscLogOperationDto fscLogOperationDto = new FscLogOperationDto();
        fscLogOperationDto.setOpType(operationType);
        fscLogOperationDto.setOpRemark(opRemark);
        fscLogOperationDto.setOldData(oldData);
        fscLogOperationDto.setNewData(newData);

        fscLogOperationService.add(fscLogOperationDto);

    }

}
